{extend name="default/base/base_seller" /}
{block name="seller_main"}
<div class="alert alert-block mt10"> <strong>{$Think.lang.instructions}：</strong>
    <ul class="mt5">
        <li>{$Think.lang.message_indicating1}</li>
        <li>{$Think.lang.message_indicating2}</li>
    </ul>
</div>
<table class="dssc-default-table">
    <thead>
        <tr>
            <th class="w30"></th>
            <th>{$Think.lang.message_content}</th>
            <th class="w200">{$Think.lang.send_time}</th>
            <th class="w70">{$Think.lang.ds_handle}</th>
        </tr>
        <tr>
            <td class="tc"><input id="all" class="checkall" type="checkbox" /></td>
            <td colspan="20"><label for="all">{$Think.lang.ds_all}</label>
                <a href="javascript:void(0);" ds_type="batchbutton" uri="{:url('Sellermsg/mark_as_read')}" name="smids" class="dssc-btn-mini"><i class="iconfont">&#xe632;</i>{$Think.lang.marked_read}</a>
                {if session('seller_is_admin')}
                <a href="javascript:void(0);" ds_type="batchbutton" uri="{:url('Sellermsg/del_msg')}" name="smids" class="dssc-btn-mini"><i class="iconfont">&#xe725;</i>{$Think.lang.ds_del}</a>
                {/if}
            </td>
        </tr>
    </thead>
    <tbody>
        {notempty name="msg_list"}
        {foreach name="msg_list" item="val"}
        <tr class="bd-line">
            <td class="tc"><input class="checkitem" type="checkbox" value="{$val.storemsg_id}" /></td>
            <td class="tl {if empty($val['storemsg_readids']) || !in_array(session('seller_id'), $val['storemsg_readids'])}fb dark{/if}">{$val.storemsg_content}</td>
            <td>{:date('Y-m-d H:i:s',$val.storemsg_addtime)}</td>
            <td class="dscs-table-handle"><span><a href="javascript:void(0);" class="btn-blue" dialog_id="store_msg_info" dialog_title="{$Think.lang.system_message}" dialog_width="480" ds_type="dialog" uri="{:url('Sellermsg/msg_info',['storemsg_id'=>$val.storemsg_id])}"><i class="iconfont">&#xe70b;</i>
                        <p>{$Think.lang.ds_view}</p>
                    </a></span></td>
        </tr>
        {/foreach}
        {else}
        <tr>
            <td colspan="20" class="norecord"><div class="warning-option"><i class="iconfont">&#xe64c;</i><span>{$Think.lang.no_record}</span></div></td>
        </tr>
        {/notempty}
    </tbody>
    <tfoot>
        {notempty name="msg_list"}
        <tr>
            <td colspan="20"><div class="pagination">{$show_page|raw}</div></td>
        </tr>
        {/notempty}
    </tfoot>
</table>

<script>
    $(function () {
        $('a[ds_type="dialog"]').click(function () {
            $(this).parents('tr:first').children('.tl').removeClass('fb dark');
        });
    });
</script>
{/block}
